<!DOCTYPE html>
<html lang="en">
<head><meta name="generator" content="Hexo 3.9.0">
    <meta charset="utf-8">
<meta name="google-site-verification" content="phJt8wJDQkOAcEQmqF8UasrF3CVtKMYLBqYLlWfVIOM">
<title>How to build an IDE with Vim - Liyuliang&#39;s Blog</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">



    <meta name="description" content="My computer develop environment12$ cat /etc/issueUbuntu 14.04 LTS">
<meta name="keywords" content="Ubuntu,Vim">
<meta property="og:type" content="article">
<meta property="og:title" content="How to build an IDE with Vim">
<meta property="og:url" content="https://liyuliang.cc/2018/03/11/How-to-build-an-IDE-with-Vim/index.html">
<meta property="og:site_name" content="Liyuliang&#39;s Blog">
<meta property="og:description" content="My computer develop environment12$ cat /etc/issueUbuntu 14.04 LTS">
<meta property="og:locale" content="en">
<meta property="og:updated_time" content="2021-06-14T14:02:02.291Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="How to build an IDE with Vim">
<meta name="twitter:description" content="My computer develop environment12$ cat /etc/issueUbuntu 14.04 LTS">





<link rel="icon" href="/images/header.png">


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.7.2/css/bulma.css">
<link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/5.4.1/css/all.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Ubuntu:400,600|Source+Code+Pro">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@9.12.0/styles/atom-one-light.css">


    
    
    
    <style>body>.footer,body>.navbar,body>.section{opacity:0}</style>
    

    
    
    
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/css/lightgallery.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/css/justifiedGallery.min.css">
    

    
    

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.css">


    
    
    
    

<link rel="stylesheet" href="/css/back-to-top.css">


    
    

    
    
    
    

    
    
<link rel="stylesheet" href="/css/progressbar.css">
<script src="https://cdn.jsdelivr.net/npm/pace-js@1.0.2/pace.min.js"></script>

    
    
    

    


<script>
        if (document.domain != "liyuliang.cc") {
            window.location.href = "https://liyuliang.cc";
        }
        if (top.location != self.location) {
           top.location = self.location;
        }

</script>
<link rel="stylesheet" href="/css/style.css">

</head>
<body class="is-2-column">
    <nav class="navbar navbar-main">
    <div class="container">
        <div class="navbar-brand is-flex-center">
            <a class="navbar-item navbar-logo" href="/">
            
                Liyuliang&#39;s Blog
            
            </a>
        </div>
        <div class="navbar-menu">
            
            <div class="navbar-start">
                
                <a class="navbar-item" href="/archives">Archives</a>
                
            </div>
            
            <div class="navbar-end">
                
                    
                    
                    <a class="navbar-item" target="_blank" title="Download on GitHub" href="https://github.com/liyuliang">
                        
                        <i class="fab fa-github"></i>
                        
                    </a>
                    
                
                
                
                <a class="navbar-item search" title="Search" href="javascript:;">
                    <i class="fas fa-search"></i>
                </a>
                
            </div>
        </div>
    </div>
</nav>
    
    <section class="section">
        <div class="container">
            <div class="columns">
                <div class="column is-8-tablet is-8-desktop is-8-widescreen has-order-2 column-main"><div class="card">
    
    <div class="card-content article ">
        
        <div class="level article-meta is-size-7 is-uppercase is-mobile is-overflow-x-auto">
            <div class="level-left">
                <time class="level-item has-text-grey" datetime="2018-03-11T08:22:11.000Z">2018-03-11</time>
                
                
                <span class="level-item has-text-grey">
                    
                    
                    8 minutes read (About 1194 words)
                </span>
                
            </div>
        </div>
        
        <h1 class="title is-size-3 is-size-4-mobile has-text-weight-normal">
            
                How to build an IDE with Vim
            
        </h1>
        <div class="content">
            <h3 id="My-computer-develop-environment"><a href="#My-computer-develop-environment" class="headerlink" title="My computer develop environment"></a>My computer develop environment</h3><figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ cat /etc/issue</span><br><span class="line">Ubuntu 14.04 LTS</span><br></pre></td></tr></table></figure>

<a id="more"></a>

<h3 id="My-computer-develop-environment-1"><a href="#My-computer-develop-environment-1" class="headerlink" title="My computer develop environment"></a>My computer develop environment</h3><figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">$ cat /etc/issue</span><br><span class="line">Ubuntu 14.04 LTS</span><br><span class="line"></span><br><span class="line">$ tmux -V</span><br><span class="line">tmux 2.8</span><br><span class="line"></span><br><span class="line">$ Iterm2</span><br><span class="line">Build 3.2.5</span><br></pre></td></tr></table></figure>

<!-- more -->

<h3 id="Install-Vim-8-0"><a href="#Install-Vim-8-0" class="headerlink" title="Install Vim 8.0:"></a>Install Vim 8.0:</h3><figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ add-apt-repository ppa:jonathonf/vim</span><br><span class="line">$ apt update</span><br><span class="line">$ apt-get install -y vim</span><br></pre></td></tr></table></figure>

<p>Maybe you will meet this problem</p>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">bash: add-apt-repository: command not found</span><br></pre></td></tr></table></figure>

<p>Then try this command</p>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ apt install software-properties-common</span><br></pre></td></tr></table></figure>

<h3 id="New-package-manage-directory"><a href="#New-package-manage-directory" class="headerlink" title="New package manage directory"></a>New package manage directory</h3><figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ mkdir -p ~/.vim/bundle/</span><br></pre></td></tr></table></figure>

<h3 id="Install-git-and-clone-vim-package-manage"><a href="#Install-git-and-clone-vim-package-manage" class="headerlink" title="Install git and clone vim package manage"></a>Install git and clone vim package manage</h3><figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ apt-get install -y git</span><br><span class="line">$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim</span><br></pre></td></tr></table></figure>

<h3 id="Create-vim-config-file"><a href="#Create-vim-config-file" class="headerlink" title="Create vim config file"></a>Create vim config file</h3><figure class="highlight yaml hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="hljs-string">$</span> <span class="hljs-string">vim</span> <span class="hljs-string">~/.vimrc</span></span><br></pre></td></tr></table></figure>

<h3 id="Copy-my-config"><a href="#Copy-my-config" class="headerlink" title="Copy my config"></a>Copy my config</h3><figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br></pre></td><td class="code"><pre><span class="line">set encoding=utf-8</span><br><span class="line">&quot; 定义快捷键的前缀，即&lt;Leader&gt;</span><br><span class="line">let mapleader=&quot;;&quot;</span><br><span class="line">&quot; 主题</span><br><span class="line">colorscheme default</span><br><span class="line">let g:Powerline_colorscheme=&apos;solarized256&apos;</span><br><span class="line"></span><br><span class="line">&quot; 设置 gvim 显示字体</span><br><span class="line">set guifont=YaHei\ Consolas\ Hybrid\ 11.5</span><br><span class="line"></span><br><span class="line">&quot; 总是显示状态栏</span><br><span class="line">set laststatus=2</span><br><span class="line">&quot; 显示光标当前位置</span><br><span class="line">set ruler</span><br><span class="line">&quot; 开启行号显示</span><br><span class="line">set number</span><br><span class="line">&quot; 高亮显示当前行/列</span><br><span class="line">set cursorline</span><br><span class="line">&quot;set cursorcolumn</span><br><span class="line"></span><br><span class="line">&quot; 高亮显示搜索结果</span><br><span class="line">set hlsearch</span><br><span class="line"></span><br><span class="line">&quot; 禁止光标闪烁</span><br><span class="line">set gcr=a:block-blinkon0</span><br><span class="line">&quot; 禁止显示滚动条</span><br><span class="line">set guioptions-=l</span><br><span class="line">set guioptions-=L</span><br><span class="line">set guioptions-=r</span><br><span class="line">set guioptions-=R</span><br><span class="line">&quot; 禁止显示菜单和工具条</span><br><span class="line">set guioptions-=m</span><br><span class="line">set guioptions-=T</span><br><span class="line"></span><br><span class="line">&quot; 基于缩进或语法进行代码折叠</span><br><span class="line">&quot; set foldmethod=indent</span><br><span class="line">set foldmethod=syntax</span><br><span class="line">&quot; 启动 vim 时关闭折叠代码</span><br><span class="line">set nofoldenable</span><br><span class="line">&quot; 禁止折行</span><br><span class="line">set nowrap</span><br><span class="line"></span><br><span class="line">&quot; 定义快捷键到行首和行尾</span><br><span class="line">nmap LB 0</span><br><span class="line">nmap LE $</span><br><span class="line">&quot; 设置快捷键将选中文本块复制至系统剪贴板</span><br><span class="line">vnoremap &lt;Leader&gt;y &quot;+y</span><br><span class="line">&quot; 设置快捷键将系统剪贴板内容粘贴至 vim</span><br><span class="line">nmap &lt;Leader&gt;p &quot;+p</span><br><span class="line">&quot; 定义快捷键关闭当前分割窗口</span><br><span class="line">nmap &lt;Leader&gt;q :q&lt;CR&gt;</span><br><span class="line">&quot; 定义快捷键保存当前窗口内容</span><br><span class="line">nmap &lt;Leader&gt;w :w&lt;CR&gt;</span><br><span class="line">&quot; 定义快捷键保存所有窗口内容并退出 vim</span><br><span class="line">nmap &lt;Leader&gt;WQ :wa&lt;CR&gt;:q&lt;CR&gt;</span><br><span class="line">&quot; 不做任何保存，直接退出 vim</span><br><span class="line">nmap &lt;Leader&gt;Q :qa!&lt;CR&gt;</span><br><span class="line">&quot; 依次遍历子窗口</span><br><span class="line">nnoremap nw &lt;C-W&gt;&lt;C-W&gt;</span><br><span class="line">&quot; 跳转至右方的窗口</span><br><span class="line">nnoremap &lt;Leader&gt;lw &lt;C-W&gt;l</span><br><span class="line">&quot; 跳转至左方的窗口</span><br><span class="line">nnoremap &lt;Leader&gt;hw &lt;C-W&gt;h</span><br><span class="line">&quot; 跳转至上方的子窗口</span><br><span class="line">nnoremap &lt;Leader&gt;kw &lt;C-W&gt;k</span><br><span class="line">&quot; 跳转至下方的子窗口</span><br><span class="line">nnoremap &lt;Leader&gt;jw &lt;C-W&gt;j</span><br><span class="line">&quot; 定义快捷键在结对符之间跳转</span><br><span class="line">nmap &lt;Leader&gt;M %</span><br><span class="line"></span><br><span class="line">&quot; 开启实时搜索功能</span><br><span class="line">set incsearch</span><br><span class="line">&quot; 搜索时大小写不敏感</span><br><span class="line">set ignorecase</span><br><span class="line">&quot; 关闭兼容模式</span><br><span class="line">set nocompatible</span><br><span class="line">&quot; vim 自身命令行模式智能补全</span><br><span class="line">set wildmenu</span><br><span class="line"></span><br><span class="line">&quot; vundle 环境设置</span><br><span class="line">filetype off</span><br><span class="line">&quot; 开启语法高亮功能</span><br><span class="line">syntax enable</span><br><span class="line">&quot; 允许用指定语法高亮配色方案替换默认方案</span><br><span class="line">syntax on</span><br><span class="line">&quot; 自适应不同语言的智能缩进</span><br><span class="line">&quot;filetype indent on</span><br><span class="line">&quot; 将制表符扩展为空格</span><br><span class="line">set expandtab</span><br><span class="line">&quot; 设置编辑时制表符占用空格数</span><br><span class="line">set tabstop=4</span><br><span class="line">&quot; &quot; 设置格式化时制表符占用空格数</span><br><span class="line">set shiftwidth=4</span><br><span class="line">&quot; 让 vim 把连续数量的空格视为一个制表符</span><br><span class="line">set softtabstop=4</span><br><span class="line"></span><br><span class="line">&quot; 随 vim 自启动</span><br><span class="line">let g:indent_guides_enable_on_vim_startup=1</span><br><span class="line">&quot; 从第二层开始可视化显示缩进</span><br><span class="line">let g:indent_guides_start_level=2</span><br><span class="line">&quot; 色块宽度</span><br><span class="line">let g:indent_guides_guide_size=1</span><br><span class="line">&quot; 快捷键 i 开/关缩进可视化</span><br><span class="line">:nmap &lt;silent&gt; &lt;Leader&gt;i &lt;Plug&gt;IndentGuidesToggle</span><br><span class="line"></span><br><span class="line">set rtp+=~/.vim/bundle/Vundle.vim</span><br><span class="line">&quot; vundle 管理的插件列表必须位于 vundle#begin() 和 vundle#end() 之间</span><br><span class="line">call vundle#begin()</span><br><span class="line">Plugin &apos;VundleVim/Vundle.vim&apos;</span><br><span class="line">Plugin &apos;altercation/vim-colors-solarized&apos;</span><br><span class="line">Plugin &apos;tomasr/molokai&apos;</span><br><span class="line">Plugin &apos;vim-scripts/phd&apos;</span><br><span class="line">Plugin &apos;Lokaltog/vim-powerline&apos;</span><br><span class="line">Plugin &apos;octol/vim-cpp-enhanced-highlight&apos;</span><br><span class="line">Plugin &apos;nathanaelkane/vim-indent-guides&apos;</span><br><span class="line">Plugin &apos;derekwyatt/vim-fswitch&apos;</span><br><span class="line">Plugin &apos;kshenoy/vim-signature&apos;</span><br><span class="line">Plugin &apos;vim-scripts/BOOKMARKS--Mark-and-Highlight-Full-Lines&apos;</span><br><span class="line">Plugin &apos;majutsushi/tagbar&apos;</span><br><span class="line">Plugin &apos;vim-scripts/indexer.tar.gz&apos;</span><br><span class="line">Plugin &apos;vim-scripts/DfrankUtil&apos;</span><br><span class="line">Plugin &apos;vim-scripts/vimprj&apos;</span><br><span class="line">Plugin &apos;dyng/ctrlsf.vim&apos;</span><br><span class="line">Plugin &apos;terryma/vim-multiple-cursors&apos;</span><br><span class="line">Plugin &apos;scrooloose/nerdcommenter&apos;</span><br><span class="line">Plugin &apos;vim-scripts/DrawIt&apos;</span><br><span class="line">Plugin &apos;SirVer/ultisnips&apos;</span><br><span class="line">Plugin &apos;Valloric/YouCompleteMe&apos;</span><br><span class="line">Plugin &apos;derekwyatt/vim-protodef&apos;</span><br><span class="line">Plugin &apos;scrooloose/nerdtree&apos;</span><br><span class="line">Plugin &apos;fholgado/minibufexpl.vim&apos;</span><br><span class="line">Plugin &apos;gcmt/wildfire.vim&apos;</span><br><span class="line">Plugin &apos;sjl/gundo.vim&apos;</span><br><span class="line">Plugin &apos;Lokaltog/vim-easymotion&apos;</span><br><span class="line">Plugin &apos;suan/vim-instant-markdown&apos;</span><br><span class="line">Plugin &apos;lilydjwg/fcitx.vim&apos;</span><br><span class="line">Plugin &apos;fatih/vim-go&apos;</span><br><span class="line">&quot; 插件列表结束</span><br><span class="line">call vundle#end()</span><br><span class="line"></span><br><span class="line">&quot; 将外部命令 wmctrl 控制窗口最大化的命令行参数封装成一个 vim 的函数</span><br><span class="line">fun! ToggleFullscreen()</span><br><span class="line">call system(&quot;wmctrl -ir &quot; . v:windowid . &quot; -b toggle,fullscreen&quot;)</span><br><span class="line">endf</span><br><span class="line">&quot; 全屏开/关快捷键</span><br><span class="line">map &lt;silent&gt; &lt;F11&gt; :call ToggleFullscreen()&lt;CR&gt;</span><br><span class="line">&quot; 启动 vim 时自动全屏</span><br><span class="line">autocmd VimEnter * call ToggleFullscreen()</span><br><span class="line">&quot; 让配置变更立即生效</span><br><span class="line">autocmd BufWritePost $MYVIMRC source $MYVIMRC</span><br><span class="line"></span><br><span class="line">&quot;</span><br><span class="line">&quot; NERDTree</span><br><span class="line">map &lt;F10&gt; :NERDTreeToggle&lt;CR&gt;</span><br><span class="line">autocmd VimEnter * NERDTree</span><br><span class="line">&quot; Jump to the main window.</span><br><span class="line">autocmd VimEnter * wincmd p</span><br><span class="line">&quot; </span><br><span class="line">let NERDTreeShowHidden=1</span><br><span class="line"></span><br><span class="line">&quot; Auto exit NERDTree if no edit file</span><br><span class="line">autocmd BufEnter * if (winnr(&quot;$&quot;) == 1 &amp;&amp; exists(&quot;b:NERDTree&quot;) &amp;&amp; b:NERDTree.isTabTree()) | q | endif</span><br><span class="line">autocmd BufEnter * if 0 == len(filter(range(1, winnr(&apos;$&apos;)), &apos;empty(getbufvar(winbufnr(v:val), &quot;&amp;bt&quot;))&apos;)) | qa! | endif</span><br></pre></td></tr></table></figure>

<p>Then press button <code>Esc</code> and input <code>:PluginInstall</code>. You can see the process of vim plugin install.</p>
<h3 id="Maybe-you-will-get-some-faults-i-have-met-i-will-share-my-solution-here"><a href="#Maybe-you-will-get-some-faults-i-have-met-i-will-share-my-solution-here" class="headerlink" title="Maybe you will get some faults i have met, i will share my solution here."></a>Maybe you will get some faults i have met, i will share my solution here.</h3><blockquote>
<p>Indexer error: Exuberant Ctags not found in PATH. You need to install Ctags to make Indexer work.</p>
</blockquote>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ apt-get install exuberant-ctags</span><br></pre></td></tr></table></figure>

<br>

<blockquote>
<p>YouCompleteMe unavailable no module named ycmd</p>
</blockquote>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ cd ~/.vim/bundle/YouCompleteMe/</span><br><span class="line">$ git submodule update --init --recursive</span><br></pre></td></tr></table></figure>

<br>


<blockquote>
<p>The ycmd server SHUT DOWN (restart with ‘:YcmRestartServer’). …M before using it. Follow the instructions in the documentation</p>
</blockquote>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ cd ~/.vim/bundle/YouCompleteMe</span><br><span class="line">$ python install.py</span><br></pre></td></tr></table></figure>

<br>

<blockquote>
<p>ERROR: Unable to find executable ‘cmake’. CMake is required to build ycmd</p>
</blockquote>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ apt-get install -y cmake</span><br></pre></td></tr></table></figure>

<br>


<blockquote>
<p>ERROR: Python headers are missing in &#x2F;usr&#x2F;include&#x2F;python2.7.</p>
</blockquote>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ apt-get install -y python3-dev python3</span><br><span class="line">$ python3 install.py --clang-completer</span><br></pre></td></tr></table></figure>

<br>

<blockquote>
<p>No CMAKE_CXX_COMPILER could be found.</p>
</blockquote>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ apt-get install -y gcc g++</span><br></pre></td></tr></table></figure>

<br>


<blockquote>
<p>Error detected while processing function <snr>15_IndentGuidesEnable[1]..indent_guides#enable[8]..indent_guides#init_script_vars[7]..indent_guides#capture_highlight:</snr></p>
</blockquote>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ vim ~/.vimrc</span><br></pre></td></tr></table></figure>

<p>Add <code>colorscheme default</code></p>
<br>


<blockquote>
<p>Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (found suitable version “3.4.3”, minimum required is “3.4”)</p>
</blockquote>
<p>You should upgrade you cmake which default version is 2.8 by <code>apt-get install -y cmake</code></p>
<figure class="highlight plain hljs"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ add-apt-repository ppa:george-edison55/cmake-3.x</span><br><span class="line">$ apt-get update</span><br><span class="line">$ apt-get instal -y cmake</span><br></pre></td></tr></table></figure>

<br>


        </div>
        
        <div class="level is-size-7 is-uppercase">
            <div class="level-start">
                <div class="level-item">
                    <span class="is-size-6 has-text-grey has-mr-7">#</span>
                    <a class="has-link-grey -link" href="/tags/Ubuntu/">Ubuntu</a>, <a class="has-link-grey -link" href="/tags/Vim/">Vim</a>
                </div>
            </div>
        </div>
        
        
        
            <p class="is-size-7">
    <b>
    Thank you for reading.<br>
    This post is copyrighted by <a href="https://liyuliang.cc">Liyuliang’s Blog.</a><br>
    If reproduced, please indicate the source: <a href="https://liyuliang.cc">Liyuliang’s Blog</a><br>
    This blog uses <a target="_blank" rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-Share-Sharing 4.0 International License Agreement </a> to license.<br>
    </b>
    <hr>
</p>
        
        
    </div>
</div>



<div class="card">
    <div class="card-content">
        <h3 class="menu-label has-text-centered">Like this article? Support the author with</h3>
        <div class="buttons is-centered">
            
                
<a class="button is-info donate">
    <span class="icon is-small">
        <i class="fab fa-alipay"></i>
    </span>
    <span>Alipay</span>
    <div class="qrcode"><img src="/images/alipay.jpeg" alt="Alipay"></div>
</a>

                
                
<a class="button is-success donate">
    <span class="icon is-small">
        <i class="fab fa-weixin"></i>
    </span>
    <span>Wechat</span>
    <div class="qrcode"><img src="/images/wxpay.jpeg" alt="Wechat"></div>
</a>

                
                <!-- Visit https://www.paypal.com/donate/buttons/ to get your donate button -->

<a class="button is-warning donate" onclick="document.getElementById(&#39;paypal-donate-form&#39;).submit()">
    <span class="icon is-small">
        <i class="fab fa-paypal"></i>
    </span>
    <span>Paypal</span>
</a>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank" id="paypal-donate-form">
    <input type="hidden" name="cmd" value="_donations">
    <input type="hidden" name="business" value="D7RUA6PUE8GM2">
    <input type="hidden" name="currency_code" value="USD">
</form>

                
        </div>
    </div>
</div>



<div class="card card-transparent">
    <div class="level post-navigation is-flex-wrap is-mobile">
        
        <div class="level-start">
            <a class="level level-item has-link-grey  article-nav-prev" href="/2018/03/26/How-to-use-time-After-and-default-in-Golang/">
                <i class="level-item fas fa-chevron-left"></i>
                <span class="level-item">How to use &#39;time.After&#39; and &#39;default&#39; in Golang</span>
            </a>
        </div>
        
        
        <div class="level-end">
            <a class="level level-item has-link-grey  article-nav-next" href="/2018/03/08/Omitmepty-in-Golang/">
                <span class="level-item">Omitmepty in Golang</span>
                <i class="level-item fas fa-chevron-right"></i>
            </a>
        </div>
        
    </div>
</div>


</div>
                
                




<div class="column is-4-tablet is-4-desktop is-4-widescreen  has-order-3 column-right is-sticky">
    
        <div class="card widget">
    <div class="card-content">
        <div class="menu">
        <h3 class="menu-label">
            Archives
        </h3>
        <ul class="menu-list">
        
        <li>
            <a class="level is-marginless" href="/archives/2018/06/">
                <span class="level-start">
                    <span class="level-item">June 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/05/">
                <span class="level-start">
                    <span class="level-item">May 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/04/">
                <span class="level-start">
                    <span class="level-item">April 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">1</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/03/">
                <span class="level-start">
                    <span class="level-item">March 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/02/">
                <span class="level-start">
                    <span class="level-item">February 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2018/01/">
                <span class="level-start">
                    <span class="level-item">January 2018</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">6</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2017/12/">
                <span class="level-start">
                    <span class="level-item">December 2017</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2017/11/">
                <span class="level-start">
                    <span class="level-item">November 2017</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">2</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2017/10/">
                <span class="level-start">
                    <span class="level-item">October 2017</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">5</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2017/09/">
                <span class="level-start">
                    <span class="level-item">September 2017</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">8</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2017/08/">
                <span class="level-start">
                    <span class="level-item">August 2017</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">10</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2017/07/">
                <span class="level-start">
                    <span class="level-item">July 2017</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">3</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2017/06/">
                <span class="level-start">
                    <span class="level-item">June 2017</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">6</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2017/05/">
                <span class="level-start">
                    <span class="level-item">May 2017</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">9</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2017/04/">
                <span class="level-start">
                    <span class="level-item">April 2017</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">7</span>
                </span>
            </a>
        </li>
        
        <li>
            <a class="level is-marginless" href="/archives/2017/03/">
                <span class="level-start">
                    <span class="level-item">March 2017</span>
                </span>
                <span class="level-end">
                    <span class="level-item tag">9</span>
                </span>
            </a>
        </li>
        
        </ul>
        </div>
    </div>
</div>
    
        
<div class="card widget">
    <div class="card-content">
        <h3 class="menu-label">
            Tag Cloud
        </h3>
        <a href="/tags/Alipay/" style="font-size: 10px;">Alipay</a> <a href="/tags/Apache/" style="font-size: 12px;">Apache</a> <a href="/tags/Baidu/" style="font-size: 10px;">Baidu</a> <a href="/tags/Canal/" style="font-size: 10px;">Canal</a> <a href="/tags/Centos/" style="font-size: 10px;">Centos</a> <a href="/tags/CloudDisk/" style="font-size: 10px;">CloudDisk</a> <a href="/tags/Daemon/" style="font-size: 11px;">Daemon</a> <a href="/tags/Elasticsearch/" style="font-size: 13px;">Elasticsearch</a> <a href="/tags/Filebeat/" style="font-size: 11px;">Filebeat</a> <a href="/tags/Glide/" style="font-size: 10px;">Glide</a> <a href="/tags/Iterm/" style="font-size: 10px;">Iterm</a> <a href="/tags/JQuery/" style="font-size: 10px;">JQuery</a> <a href="/tags/Keepalived/" style="font-size: 10px;">Keepalived</a> <a href="/tags/Kibana/" style="font-size: 11px;">Kibana</a> <a href="/tags/Linux/" style="font-size: 10px;">Linux</a> <a href="/tags/Login/" style="font-size: 10px;">Login</a> <a href="/tags/Logstash/" style="font-size: 11px;">Logstash</a> <a href="/tags/Mac/" style="font-size: 14px;">Mac</a> <a href="/tags/Mongodb/" style="font-size: 11px;">Mongodb</a> <a href="/tags/Mycat/" style="font-size: 10px;">Mycat</a> <a href="/tags/Mysql/" style="font-size: 19px;">Mysql</a> <a href="/tags/NFS/" style="font-size: 10px;">NFS</a> <a href="/tags/Nginx/" style="font-size: 10px;">Nginx</a> <a href="/tags/Nodejs/" style="font-size: 10px;">Nodejs</a> <a href="/tags/PHP/" style="font-size: 18px;">PHP</a> <a href="/tags/Pagespeed/" style="font-size: 10px;">Pagespeed</a> <a href="/tags/Partition/" style="font-size: 10px;">Partition</a> <a href="/tags/Redis/" style="font-size: 12px;">Redis</a> <a href="/tags/Replica/" style="font-size: 10px;">Replica</a> <a href="/tags/Security/" style="font-size: 10px;">Security</a> <a href="/tags/Slave/" style="font-size: 13px;">Slave</a> <a href="/tags/SlowLog/" style="font-size: 11px;">SlowLog</a> <a href="/tags/Symfony/" style="font-size: 15px;">Symfony</a> <a href="/tags/TCP/" style="font-size: 10px;">TCP</a> <a href="/tags/Twig/" style="font-size: 11px;">Twig</a> <a href="/tags/Ubuntu/" style="font-size: 20px;">Ubuntu</a> <a href="/tags/Varnish/" style="font-size: 10px;">Varnish</a> <a href="/tags/Vim/" style="font-size: 10px;">Vim</a> <a href="/tags/Virtualbox/" style="font-size: 10px;">Virtualbox</a> <a href="/tags/Wordpress/" style="font-size: 11px;">Wordpress</a> <a href="/tags/auth/" style="font-size: 11px;">auth</a> <a href="/tags/backup/" style="font-size: 10px;">backup</a> <a href="/tags/beanstalkd/" style="font-size: 10px;">beanstalkd</a> <a href="/tags/binlog/" style="font-size: 10px;">binlog</a> <a href="/tags/blog/" style="font-size: 10px;">blog</a> <a href="/tags/brew/" style="font-size: 11px;">brew</a> <a href="/tags/composer/" style="font-size: 10px;">composer</a> <a href="/tags/cookie/" style="font-size: 10px;">cookie</a> <a href="/tags/css/" style="font-size: 10px;">css</a> <a href="/tags/dante/" style="font-size: 10px;">dante</a> <a href="/tags/docker/" style="font-size: 12px;">docker</a> <a href="/tags/domain/" style="font-size: 11px;">domain</a> <a href="/tags/download/" style="font-size: 10px;">download</a> <a href="/tags/file/" style="font-size: 10px;">file</a> <a href="/tags/fork/" style="font-size: 10px;">fork</a> <a href="/tags/git/" style="font-size: 11px;">git</a> <a href="/tags/github/" style="font-size: 10px;">github</a> <a href="/tags/gitlab/" style="font-size: 10px;">gitlab</a> <a href="/tags/golang/" style="font-size: 17px;">golang</a> <a href="/tags/homestead/" style="font-size: 10px;">homestead</a> <a href="/tags/iptable/" style="font-size: 11px;">iptable</a> <a href="/tags/laravel/" style="font-size: 10px;">laravel</a> <a href="/tags/log/" style="font-size: 10px;">log</a> <a href="/tags/nginx/" style="font-size: 16px;">nginx</a> <a href="/tags/proxy/" style="font-size: 11px;">proxy</a> <a href="/tags/redis-cluster/" style="font-size: 10px;">redis-cluster</a> <a href="/tags/redis-sentinel/" style="font-size: 10px;">redis-sentinel</a> <a href="/tags/sock5/" style="font-size: 10px;">sock5</a> <a href="/tags/supervisor/" style="font-size: 10px;">supervisor</a> <a href="/tags/sync/" style="font-size: 10px;">sync</a> <a href="/tags/tips/" style="font-size: 11px;">tips</a> <a href="/tags/tmux/" style="font-size: 10px;">tmux</a> <a href="/tags/usb/" style="font-size: 10px;">usb</a> <a href="/tags/vagrant/" style="font-size: 10px;">vagrant</a> <a href="/tags/web/" style="font-size: 10px;">web</a>
    </div>
</div>

    
        


    
    
</div>

            </div>
        </div>
    </section>
    <footer class="footer">
    <div class="container">
        <div class="level">
            <div class="level-start has-text-centered-mobile">
                <a class="footer-logo is-block has-mb-6" href="/">
                
                    Liyuliang&#39;s Blog
                
                </a>

                <p class="is-size-7">
                    <a href="/copyright" target="_blank">Copyright</a>
                    &copy; 2022 Liyuliang&nbsp;

		    <a target="_blank" href="https://beian.miit.gov.cn">粤ICP备18120141号</a>
                </p>
            </div>
            <div class="level-end">
            
                <div class="field has-addons is-flex-center-mobile has-mt-5-mobile is-flex-wrap is-flex-middle">
                
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="Creative Commons" href="https://creativecommons.org/">
                        
                        <i class="fab fa-creative-commons"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="Attribution 4.0 International" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">
                        
                        <i class="fab fa-creative-commons-by"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="Download on GitHub" href="https://github.com/liyuliang">
                        
                        <i class="fab fa-github"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="SiteMap for Google" href="https://liyuliang.cc/sitemap.xml">
                        
                        <i class="fab fa-google"></i>
                        
                    </a>
                </p>
                
                <p class="control">
                    <a class="button is-white is-large" target="_blank" title="SiteMap for Baidu" href="https://liyuliang.cc/baidusitemap.xml">
                        
                        <i class="fab fa-bimobject"></i>
                        
                    </a>
                </p>
                
                </div>
            
            </div>
        </div>
    </div>
</footer>

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/moment@2.22.2/min/moment-with-locales.min.js"></script>
<script>moment.locale("en");</script>


    
    
    
    <script src="/js/animation.js"></script>
    

    
    
    
    <script src="https://cdn.jsdelivr.net/npm/lightgallery@1.6.8/dist/js/lightgallery.min.js" defer></script>
    <script src="https://cdn.jsdelivr.net/npm/justifiedGallery@3.7.0/dist/js/jquery.justifiedGallery.min.js" defer></script>
    <script src="/js/gallery.js" defer></script>
    

    
    

<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Update your browser to view this website correctly. <a id="btnUpdateBrowser" href="http://outdatedbrowser.com/">Update
            my browser now </a></p>
    <p class="last"><a href="#" id="btnCloseUpdateBrowser" title="Close">&times;</a></p>
</div>
<script src="https://cdn.jsdelivr.net/npm/outdatedbrowser@1.1.5/outdatedbrowser/outdatedbrowser.min.js" defer></script>
<script>
    document.addEventListener("DOMContentLoaded", function () {
        outdatedBrowser({
            bgColor: '#f25648',
            color: '#ffffff',
            lowerThan: 'flex'
        });
    });
</script>


    
    
<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.5/unpacked/MathJax.js?config=TeX-MML-AM_CHTML" defer></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
    MathJax.Hub.Config({
        'HTML-CSS': {matchFontHeight: false},
        SVG: {matchFontHeight: false},
        CommonHTML: {matchFontHeight: false}
    });
});
</script>

    
    

<a id="back-to-top" title="Back to Top" href="javascript:;">
    <i class="fas fa-chevron-up"></i>
</a>
<script src="/js/back-to-top.js" defer></script>


    
    

    
    
    
    

    
    
    
    
    
    <script src="https://cdn.jsdelivr.net/npm/clipboard@2.0.4/dist/clipboard.min.js" defer></script>
    <script src="/js/clipboard.js" defer></script>
    

    


<script src="/js/main.js" defer></script>

    
    <div class="searchbox ins-search">
    <div class="searchbox-container ins-search-container">
        <div class="searchbox-input-wrapper">
            <input type="text" class="searchbox-input ins-search-input" placeholder="Type something...">
            <span class="searchbox-close ins-close ins-selectable"><i class="fa fa-times-circle"></i></span>
        </div>
        <div class="searchbox-result-wrapper ins-section-wrapper">
            <div class="ins-section-container"></div>
        </div>
    </div>
</div>
<script>
    (function (window) {
        var INSIGHT_CONFIG = {
            TRANSLATION: {
                POSTS: 'Posts',
                PAGES: 'Pages',
                CATEGORIES: 'Categories',
                TAGS: 'Tags',
                UNTITLED: '(Untitled)',
            },
            CONTENT_URL: '/content.json',
        };
        window.INSIGHT_CONFIG = INSIGHT_CONFIG;
    })(window);
</script>
<script src="/js/insight.js" defer></script>
<link rel="stylesheet" href="/css/search.css">
<link rel="stylesheet" href="/css/insight.css">
    
</body>
</html>